package com.fxm.controller;

import com.fxm.constant.RedisConstants;
import com.fxm.returns.RespCode;
import com.fxm.returns.RespEntity;
import com.fxm.service.SignInService;
import com.fxm.utils.RedisUtil;
import com.fxm.vo.param.OpenParam;
import com.fxm.vo.result.SignResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Objects;


/**
 * <p>
 * 用户签到 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2020-12-30
 */
@RestController
@RequestMapping("/sign")
@Slf4j
@Api(value = "登陆签到接口", tags = "登陆签到接口")
public class SignInController {

    @Resource
    private SignInService signInService;

    @PostMapping("/count")
    @ApiOperation(value = "查询用户签到次数")
    public RespEntity<SignResult> getUserSignInfo(@RequestBody OpenParam openParam) {
        RespEntity<SignResult> respEntity = signInService.getSignInValue(openParam);
        return respEntity;
    }
}
